using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Dynamic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Linq.Expressions;
using System.Numerics;
using System.Text;
using ns19;
using ns20;

namespace Newtonsoft.Json.Linq
{
	public abstract class JToken : IEnumerable<JToken>, IJEnumerable<JToken>, IEnumerable, ICloneable, IDynamicMetaObjectProvider, IJsonLineInfo
	{
		private JContainer jcontainer_0;

		private JToken jtoken_0;

		private JToken jtoken_1;

		private static JTokenEqualityComparer jtokenEqualityComparer_0;

		private int? nullable_0;

		private int? nullable_1;

		private static readonly JTokenType[] jtokenType_0 = new JTokenType[6]
		{
			JTokenType.Integer,
			JTokenType.Float,
			JTokenType.String,
			JTokenType.Comment,
			JTokenType.Raw,
			JTokenType.Boolean
		};

		private static readonly JTokenType[] jtokenType_1 = new JTokenType[6]
		{
			JTokenType.Integer,
			JTokenType.Float,
			JTokenType.String,
			JTokenType.Comment,
			JTokenType.Raw,
			JTokenType.Boolean
		};

		private static readonly JTokenType[] jtokenType_2 = new JTokenType[7]
		{
			JTokenType.Integer,
			JTokenType.Float,
			JTokenType.String,
			JTokenType.Comment,
			JTokenType.Raw,
			JTokenType.Boolean,
			JTokenType.Bytes
		};

		private static readonly JTokenType[] jtokenType_3 = new JTokenType[11]
		{
			JTokenType.Date,
			JTokenType.Integer,
			JTokenType.Float,
			JTokenType.String,
			JTokenType.Comment,
			JTokenType.Raw,
			JTokenType.Boolean,
			JTokenType.Bytes,
			JTokenType.Guid,
			JTokenType.TimeSpan,
			JTokenType.Uri
		};

		private static readonly JTokenType[] jtokenType_4 = new JTokenType[5]
		{
			JTokenType.String,
			JTokenType.Comment,
			JTokenType.Raw,
			JTokenType.Guid,
			JTokenType.Bytes
		};

		private static readonly JTokenType[] jtokenType_5 = new JTokenType[4]
		{
			JTokenType.String,
			JTokenType.Comment,
			JTokenType.Raw,
			JTokenType.TimeSpan
		};

		private static readonly JTokenType[] jtokenType_6 = new JTokenType[4]
		{
			JTokenType.String,
			JTokenType.Comment,
			JTokenType.Raw,
			JTokenType.Uri
		};

		private static readonly JTokenType[] jtokenType_7 = new JTokenType[5]
		{
			JTokenType.Integer,
			JTokenType.Float,
			JTokenType.String,
			JTokenType.Comment,
			JTokenType.Raw
		};

		private static readonly JTokenType[] jtokenType_8 = new JTokenType[4]
		{
			JTokenType.Date,
			JTokenType.String,
			JTokenType.Comment,
			JTokenType.Raw
		};

		private static readonly JTokenType[] jtokenType_9 = new JTokenType[5]
		{
			JTokenType.Bytes,
			JTokenType.String,
			JTokenType.Comment,
			JTokenType.Raw,
			JTokenType.Integer
		};

		public static JTokenEqualityComparer EqualityComparer
		{
			get
			{
				if (jtokenEqualityComparer_0 == null)
				{
					jtokenEqualityComparer_0 = new JTokenEqualityComparer();
				}
				return jtokenEqualityComparer_0;
			}
		}

		public JContainer Parent
		{
			[DebuggerStepThrough]
			get
			{
				return jcontainer_0;
			}
			internal set
			{
				jcontainer_0 = value;
			}
		}

		public JToken Root
		{
			get
			{
				JContainer parent = Parent;
				if (parent == null)
				{
					return this;
				}
				while (parent.Parent != null)
				{
					parent = parent.Parent;
				}
				return parent;
			}
		}

		public abstract JTokenType Type { get; }

		public abstract bool HasValues { get; }

		public JToken Next
		{
			get
			{
				return jtoken_1;
			}
			internal set
			{
				jtoken_1 = value;
			}
		}

		public JToken Previous
		{
			get
			{
				return jtoken_0;
			}
			internal set
			{
				jtoken_0 = value;
			}
		}

		public string Path
		{
			get
			{
				if (Parent == null)
				{
					return string.Empty;
				}
				IList<JToken> list = Ancestors().Reverse().ToList();
				list.Add(this);
				StringBuilder stringBuilder = new StringBuilder();
				for (int i = 0; i < list.Count; i++)
				{
					JToken jToken = list[i];
					JToken jToken2 = ((i + 1 < list.Count) ? list[i + 1] : null);
					if (jToken2 == null)
					{
						continue;
					}
					switch (jToken.Type)
					{
					case JTokenType.Array:
					case JTokenType.Constructor:
					{
						int num = ((IList<JToken>)jToken).IndexOf(jToken2);
						stringBuilder.Append("[" + num + "]");
						break;
					}
					case JTokenType.Property:
					{
						JProperty jProperty = (JProperty)jToken;
						if (stringBuilder.Length > 0)
						{
							stringBuilder.Append(".");
						}
						stringBuilder.Append(jProperty.Name);
						break;
					}
					}
				}
				return stringBuilder.ToString();
			}
		}

		public virtual JToken this[object key]
		{
			get
			{
				throw new InvalidOperationException("Cannot access child value on {0}.".smethod_0(CultureInfo.InvariantCulture, GetType()));
			}
			set
			{
				throw new InvalidOperationException("Cannot set child value on {0}.".smethod_0(CultureInfo.InvariantCulture, GetType()));
			}
		}

		public virtual JToken First
		{
			get
			{
				throw new InvalidOperationException("Cannot access child value on {0}.".smethod_0(CultureInfo.InvariantCulture, GetType()));
			}
		}

		public virtual JToken Last
		{
			get
			{
				throw new InvalidOperationException("Cannot access child value on {0}.".smethod_0(CultureInfo.InvariantCulture, GetType()));
			}
		}

		IJEnumerable<JToken> IJEnumerable<JToken>.this[object key] => this[key];

		int IJsonLineInfo.LineNumber => nullable_0 ?? 0;

		int IJsonLineInfo.LinePosition => nullable_1 ?? 0;

		internal abstract JToken Newtonsoft_002EJson_002ELinq_002EJToken_002E_206F_206A_202E_200B_200D_206A_200C_200E_206A_202D_200E_206E_206F_200B_206C_200F_200C_200C_202A_206B_200C_202D_200B_202B_202A_202D_202B_206A_206F_206F_202D_200C_206F_202E_206B_200D_206C_202D_202E_200E_202E();

		internal abstract bool Newtonsoft_002EJson_002ELinq_002EJToken_002E_206F_200C_206F_206F_206B_200E_206C_206B_200C_200D_202E_200E_200E_200D_202C_200D_200C_206B_200F_202D_202E_200F_200C_202D_206B_200D_206B_206E_202E_206E_202B_206D_206E_206F_202C_202E_200D_200C_200D_200F_202E(JToken jtoken_2);

		public static bool DeepEquals(JToken t1, JToken t2)
		{
			if (t1 != t2)
			{
				if (t1 != null && t2 != null)
				{
					return t1.Newtonsoft_002EJson_002ELinq_002EJToken_002E_206F_200C_206F_206F_206B_200E_206C_206B_200C_200D_202E_200E_200E_200D_202C_200D_200C_206B_200F_202D_202E_200F_200C_202D_206B_200D_206B_206E_202E_206E_202B_206D_206E_206F_202C_202E_200D_200C_200D_200F_202E(t2);
				}
				return false;
			}
			return true;
		}

		internal JToken()
		{
		}

		public void AddAfterSelf(object content)
		{
			if (jcontainer_0 == null)
			{
				throw new InvalidOperationException("The parent is missing.");
			}
			int num = jcontainer_0.method_6(this);
			jcontainer_0.method_8(num + 1, content, bool_1: false);
		}

		public void AddBeforeSelf(object content)
		{
			if (jcontainer_0 == null)
			{
				throw new InvalidOperationException("The parent is missing.");
			}
			int int_ = jcontainer_0.method_6(this);
			jcontainer_0.method_8(int_, content, bool_1: false);
		}

		public IEnumerable<JToken> Ancestors()
		{
			for (JToken parent = Parent; parent != null; parent = parent.Parent)
			{
				yield return parent;
			}
		}

		public IEnumerable<JToken> AfterSelf()
		{
			if (Parent != null)
			{
				for (JToken next = Next; next != null; next = next.Next)
				{
					yield return next;
				}
			}
		}

		public IEnumerable<JToken> BeforeSelf()
		{
			for (JToken jToken = Parent.First; jToken != this; jToken = jToken.Next)
			{
				yield return jToken;
			}
		}

		public virtual T Value<T>(object key)
		{
			JToken gparam_ = this[key];
			return gparam_.smethod_2<JToken, T>();
		}

		public virtual JEnumerable<JToken> Children()
		{
			return JEnumerable<JToken>.Empty;
		}

		public JEnumerable<T> Children<T>() where T : JToken
		{
			return new JEnumerable<T>(Children().OfType<T>());
		}

		public virtual IEnumerable<T> Values<T>()
		{
			throw new InvalidOperationException("Cannot access child value on {0}.".smethod_0(CultureInfo.InvariantCulture, GetType()));
		}

		public void Remove()
		{
			if (jcontainer_0 == null)
			{
				throw new InvalidOperationException("The parent is missing.");
			}
			jcontainer_0.Newtonsoft_002EJson_002ELinq_002EJContainer_002E_202E_200B_202D_206B_200C_200B_200B_200D_202B_202B_206F_202C_206C_202D_200D_200F_202E_206B_206B_206C_206F_202D_206F_200D_202E_202E_206B_206B_200F_200C_200C_206C_200E_202B_200F_206F_206A_200C_206B_200F_202E(this);
		}

		public void Replace(JToken value)
		{
			if (jcontainer_0 == null)
			{
				throw new InvalidOperationException("The parent is missing.");
			}
			jcontainer_0.vmethod_1(this, value);
		}

		public abstract void WriteTo(JsonWriter writer, params JsonConverter[] converters);

		public override string ToString()
		{
			return ToString(Formatting.Indented);
		}

		public string ToString(Formatting formatting, params JsonConverter[] converters)
		{
			using StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture);
			JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter);
			jsonTextWriter.Formatting = formatting;
			WriteTo(jsonTextWriter, converters);
			return stringWriter.ToString();
		}

		private static JValue smethod_0(JToken jtoken_2)
		{
			if (jtoken_2 == null)
			{
				throw new ArgumentNullException("value");
			}
			if (jtoken_2 is JProperty)
			{
				jtoken_2 = ((JProperty)jtoken_2).Value;
			}
			return jtoken_2 as JValue;
		}

		private static string smethod_1(JToken jtoken_2)
		{
			Class204.smethod_2(jtoken_2, "token");
			if (jtoken_2 is JProperty)
			{
				jtoken_2 = ((JProperty)jtoken_2).Value;
			}
			return jtoken_2.Type.ToString();
		}

		private static bool smethod_2(JToken jtoken_2, JTokenType[] jtokenType_10, bool bool_0)
		{
			if (Array.IndexOf(jtokenType_10, jtoken_2.Type) == -1)
			{
				if (bool_0)
				{
					if (jtoken_2.Type != JTokenType.Null)
					{
						return jtoken_2.Type == JTokenType.Undefined;
					}
					return true;
				}
				return false;
			}
			return true;
		}

		public static explicit operator bool(JToken value)
		{
			JValue jValue = smethod_0(value);
			if (jValue != null && smethod_2(jValue, jtokenType_0, bool_0: false))
			{
				if (jValue.Value is BigInteger)
				{
					return Convert.ToBoolean((int)(BigInteger)jValue.Value);
				}
				return Convert.ToBoolean(jValue.Value, CultureInfo.InvariantCulture);
			}
			throw new ArgumentException("Can not convert {0} to Boolean.".smethod_0(CultureInfo.InvariantCulture, smethod_1(value)));
		}

		public static explicit operator DateTimeOffset(JToken value)
		{
			JValue jValue = smethod_0(value);
			if (jValue != null && smethod_2(jValue, jtokenType_8, bool_0: false))
			{
				if (jValue.Value is DateTimeOffset)
				{
					return (DateTimeOffset)jValue.Value;
				}
				if (jValue.Value is string)
				{
					return DateTimeOffset.Parse((string)jValue.Value, CultureInfo.InvariantCulture);
				}
				return new DateTimeOffset(Convert.ToDateTime(jValue.Value, CultureInfo.InvariantCulture));
			}
			throw new ArgumentException("Can not convert {0} to DateTimeOffset.".smethod_0(CultureInfo.InvariantCulture, smethod_1(value)));
		}

		public static explicit operator bool?(JToken value)
		{
			if (value == null)
			{
				return null;
			}
			JValue jValue = smethod_0(value);
			if (jValue != null && smethod_2(jValue, jtokenType_0, bool_0: true))
			{
				if (jValue.Value is BigInteger)
				{
					return Convert.ToBoolean((int)(BigInteger)jValue.Value);
				}
				if (jValue.Value == null)
				{
					return null;
				}
				return Convert.ToBoolean(jValue.Value, CultureInfo.InvariantCulture);
			}
			throw new ArgumentException("Can not convert {0} to Boolean.".smethod_0(CultureInfo.InvariantCulture, smethod_1(value)));
		}

		public static explicit operator long(JToken value)
		{
			JValue jValue = smethod_0(value);
			if (jValue != null && smethod_2(jValue, jtokenType_1, bool_0: false))
			{
				if (jValue.Value is BigInteger)
				{
					return (long)(BigInteger)jValue.Value;
				}
				return Convert.ToInt64(jValue.Value, CultureInfo.InvariantCulture);
			}
			throw new ArgumentException("Can not convert {0} to Int64.".smethod_0(CultureInfo.InvariantCulture, smethod_1(value)));
		}

		public static explicit operator DateTime?(JToken value)
		{
			if (value == null)
			{
				return null;
			}
			JValue jValue = smethod_0(value);
			if (jValue != null && smethod_2(jValue, jtokenType_8, bool_0: true))
			{
				if (jValue.Value is DateTimeOffset)
				{
					return ((DateTimeOffset)jValue.Value).DateTime;
				}
				if (jValue.Value == null)
				{
					return null;
				}
				return Convert.ToDateTime(jValue.Value, CultureInfo.InvariantCulture);
			}
			throw new ArgumentException("Can not convert {0} to DateTime.".smethod_0(CultureInfo.InvariantCulture, smethod_1(value)));
		}

		public static explicit operator DateTimeOffset?(JToken value)
		{
			if (value == null)
			{
				return null;
			}
			JValue jValue = smethod_0(value);
			if (jValue != null && smethod_2(jValue, jtokenType_8, bool_0: true))
			{
				if (jValue.Value == null)
				{
					return null;
				}
				if (jValue.Value is DateTimeOffset)
				{
					return (DateTimeOffset?)jValue.Value;
				}
				if (jValue.Value is string)
				{
					return DateTimeOffset.Parse((string)jValue.Value, CultureInfo.InvariantCulture);
				}
				return new DateTimeOffset(Convert.ToDateTime(jValue.Value, CultureInfo.InvariantCulture));
			}
			throw new ArgumentException("Can not convert {0} to DateTimeOffset.".smethod_0(CultureInfo.InvariantCulture, smethod_1(value)));
		}

		public static explicit operator decimal?(JToken value)
		{
			if (value == null)
			{
				return null;
			}
			JValue jValue = smethod_0(value);
			if (jValue != null && smethod_2(jValue, jtokenType_1, bool_0: true))
			{
				if (jValue.Value is BigInteger)
				{
					return (decimal)(BigInteger)jValue.Value;
				}
				if (jValue.Value == null)
				{
					return null;
				}
				return Convert.ToDecimal(jValue.Value, CultureInfo.InvariantCulture);
			}
			throw new ArgumentException("Can not convert {0} to Decimal.".smethod_0(CultureInfo.InvariantCulture, smethod_1(value)));
		}

		public static explicit operator double?(JToken value)
		{
			if (value == null)
			{
				return null;
			}
			JValue jValue = smethod_0(value);
			if (jValue != null && smethod_2(jValue, jtokenType_1, bool_0: true))
			{
				if (jValue.Value is BigInteger)
				{
					return (double)(BigInteger)jValue.Value;
				}
				if (jValue.Value == null)
				{
					return null;
				}
				return Convert.ToDouble(jValue.Value, CultureInfo.InvariantCulture);
			}
			throw new ArgumentException("Can not convert {0} to Double.".smethod_0(CultureInfo.InvariantCulture, smethod_1(value)));
		}

		public static explicit operator char?(JToken value)
		{
			if (value == null)
			{
				return null;
			}
			JValue jValue = smethod_0(value);
			if (jValue != null && smethod_2(jValue, jtokenType_7, bool_0: true))
			{
				if (jValue.Value is BigInteger)
				{
					return (char)(ushort)(BigInteger)jValue.Value;
				}
				if (jValue.Value == null)
				{
					return null;
				}
				return Convert.ToChar(jValue.Value, CultureInfo.InvariantCulture);
			}
			throw new ArgumentException("Can not convert {0} to Char.".smethod_0(CultureInfo.InvariantCulture, smethod_1(value)));
		}

		public static explicit operator int(JToken value)
		{
			JValue jValue = smethod_0(value);
			if (jValue != null && smethod_2(jValue, jtokenType_1, bool_0: false))
			{
				if (jValue.Value is BigInteger)
				{
					return (int)(BigInteger)jValue.Value;
				}
				return Convert.ToInt32(jValue.Value, CultureInfo.InvariantCulture);
			}
			throw new ArgumentException("Can not convert {0} to Int32.".smethod_0(CultureInfo.InvariantCulture, smethod_1(value)));
		}

		public static explicit operator short(JToken value)
		{
			JValue jValue = smethod_0(value);
			if (jValue != null && smethod_2(jValue, jtokenType_1, bool_0: false))
			{
				if (jValue.Value is BigInteger)
				{
					return (short)(BigInteger)jValue.Value;
				}
				return Convert.ToInt16(jValue.Value, CultureInfo.InvariantCulture);
			}
			throw new ArgumentException("Can not convert {0} to Int16.".smethod_0(CultureInfo.InvariantCulture, smethod_1(value)));
		}

		[CLSCompliant(false)]
		public static explicit operator ushort(JToken value)
		{
			JValue jValue = smethod_0(value);
			if (jValue != null && smethod_2(jValue, jtokenType_1, bool_0: false))
			{
				if (jValue.Value is BigInteger)
				{
					return (ushort)(BigInteger)jValue.Value;
				}
				return Convert.ToUInt16(jValue.Value, CultureInfo.InvariantCulture);
			}
			throw new ArgumentException("Can not convert {0} to UInt16.".smethod_0(CultureInfo.InvariantCulture, smethod_1(value)));
		}

		[CLSCompliant(false)]
		public static explicit operator char(JToken value)
		{
			JValue jValue = smethod_0(value);
			if (jValue != null && smethod_2(jValue, jtokenType_7, bool_0: false))
			{
				if (jValue.Value is BigInteger)
				{
					return (char)(ushort)(BigInteger)jValue.Value;
				}
				return Convert.ToChar(jValue.Value, CultureInfo.InvariantCulture);
			}
			throw new ArgumentException("Can not convert {0} to Char.".smethod_0(CultureInfo.InvariantCulture, smethod_1(value)));
		}

		public static explicit operator byte(JToken value)
		{
			JValue jValue = smethod_0(value);
			if (jValue != null && smethod_2(jValue, jtokenType_1, bool_0: false))
			{
				if (jValue.Value is BigInteger)
				{
					return (byte)(BigInteger)jValue.Value;
				}
				return Convert.ToByte(jValue.Value, CultureInfo.InvariantCulture);
			}
			throw new ArgumentException("Can not convert {0} to Byte.".smethod_0(CultureInfo.InvariantCulture, smethod_1(value)));
		}

		public static explicit operator int?(JToken value)
		{
			if (value == null)
			{
				return null;
			}
			JValue jValue = smethod_0(value);
			if (jValue != null && smethod_2(jValue, jtokenType_1, bool_0: true))
			{
				if (jValue.Value is BigInteger)
				{
					return (int)(BigInteger)jValue.Value;
				}
				if (jValue.Value == null)
				{
					return null;
				}
				return Convert.ToInt32(jValue.Value, CultureInfo.InvariantCulture);
			}
			throw new ArgumentException("Can not convert {0} to Int32.".smethod_0(CultureInfo.InvariantCulture, smethod_1(value)));
		}

		public static explicit operator short?(JToken value)
		{
			if (value == null)
			{
				return null;
			}
			JValue jValue = smethod_0(value);
			if (jValue != null && smethod_2(jValue, jtokenType_1, bool_0: true))
			{
				if (jValue.Value is BigInteger)
				{
					return (short)(BigInteger)jValue.Value;
				}
				if (jValue.Value == null)
				{
					return null;
				}
				return Convert.ToInt16(jValue.Value, CultureInfo.InvariantCulture);
			}
			throw new ArgumentException("Can not convert {0} to Int16.".smethod_0(CultureInfo.InvariantCulture, smethod_1(value)));
		}

		[CLSCompliant(false)]
		public static explicit operator ushort?(JToken value)
		{
			if (value == null)
			{
				return null;
			}
			JValue jValue = smethod_0(value);
			if (jValue != null && smethod_2(jValue, jtokenType_1, bool_0: true))
			{
				if (jValue.Value is BigInteger)
				{
					return (ushort)(BigInteger)jValue.Value;
				}
				if (jValue.Value == null)
				{
					return null;
				}
				return Convert.ToUInt16(jValue.Value, CultureInfo.InvariantCulture);
			}
			throw new ArgumentException("Can not convert {0} to UInt16.".smethod_0(CultureInfo.InvariantCulture, smethod_1(value)));
		}

		public static explicit operator byte?(JToken value)
		{
			if (value == null)
			{
				return null;
			}
			JValue jValue = smethod_0(value);
			if (jValue != null && smethod_2(jValue, jtokenType_1, bool_0: true))
			{
				if (jValue.Value is BigInteger)
				{
					return (byte)(BigInteger)jValue.Value;
				}
				if (jValue.Value == null)
				{
					return null;
				}
				return Convert.ToByte(jValue.Value, CultureInfo.InvariantCulture);
			}
			throw new ArgumentException("Can not convert {0} to Byte.".smethod_0(CultureInfo.InvariantCulture, smethod_1(value)));
		}

		public static explicit operator DateTime(JToken value)
		{
			JValue jValue = smethod_0(value);
			if (jValue != null && smethod_2(jValue, jtokenType_8, bool_0: false))
			{
				if (jValue.Value is DateTimeOffset)
				{
					return ((DateTimeOffset)jValue.Value).DateTime;
				}
				return Convert.ToDateTime(jValue.Value, CultureInfo.InvariantCulture);
			}
			throw new ArgumentException("Can not convert {0} to DateTime.".smethod_0(CultureInfo.InvariantCulture, smethod_1(value)));
		}

		public static explicit operator long?(JToken value)
		{
			if (value == null)
			{
				return null;
			}
			JValue jValue = smethod_0(value);
			if (jValue != null && smethod_2(jValue, jtokenType_1, bool_0: true))
			{
				if (jValue.Value is BigInteger)
				{
					return (long)(BigInteger)jValue.Value;
				}
				if (jValue.Value == null)
				{
					return null;
				}
				return Convert.ToInt64(jValue.Value, CultureInfo.InvariantCulture);
			}
			throw new ArgumentException("Can not convert {0} to Int64.".smethod_0(CultureInfo.InvariantCulture, smethod_1(value)));
		}

		public static explicit operator float?(JToken value)
		{
			if (value == null)
			{
				return null;
			}
			JValue jValue = smethod_0(value);
			if (jValue != null && smethod_2(jValue, jtokenType_1, bool_0: true))
			{
				if (jValue.Value is BigInteger)
				{
					return (float)(BigInteger)jValue.Value;
				}
				if (jValue.Value == null)
				{
					return null;
				}
				return Convert.ToSingle(jValue.Value, CultureInfo.InvariantCulture);
			}
			throw new ArgumentException("Can not convert {0} to Single.".smethod_0(CultureInfo.InvariantCulture, smethod_1(value)));
		}

		public static explicit operator decimal(JToken value)
		{
			JValue jValue = smethod_0(value);
			if (jValue != null && smethod_2(jValue, jtokenType_1, bool_0: false))
			{
				if (jValue.Value is BigInteger)
				{
					return (decimal)(BigInteger)jValue.Value;
				}
				return Convert.ToDecimal(jValue.Value, CultureInfo.InvariantCulture);
			}
			throw new ArgumentException("Can not convert {0} to Decimal.".smethod_0(CultureInfo.InvariantCulture, smethod_1(value)));
		}

		[CLSCompliant(false)]
		public static explicit operator uint?(JToken value)
		{
			if (value == null)
			{
				return null;
			}
			JValue jValue = smethod_0(value);
			if (jValue != null && smethod_2(jValue, jtokenType_1, bool_0: true))
			{
				if (jValue.Value is BigInteger)
				{
					return (uint)(BigInteger)jValue.Value;
				}
				if (jValue.Value == null)
				{
					return null;
				}
				return Convert.ToUInt32(jValue.Value, CultureInfo.InvariantCulture);
			}
			throw new ArgumentException("Can not convert {0} to UInt32.".smethod_0(CultureInfo.InvariantCulture, smethod_1(value)));
		}

		[CLSCompliant(false)]
		public static explicit operator ulong?(JToken value)
		{
			if (value == null)
			{
				return null;
			}
			JValue jValue = smethod_0(value);
			if (jValue != null && smethod_2(jValue, jtokenType_1, bool_0: true))
			{
				if (jValue.Value is BigInteger)
				{
					return (ulong)(BigInteger)jValue.Value;
				}
				if (jValue.Value == null)
				{
					return null;
				}
				return Convert.ToUInt64(jValue.Value, CultureInfo.InvariantCulture);
			}
			throw new ArgumentException("Can not convert {0} to UInt64.".smethod_0(CultureInfo.InvariantCulture, smethod_1(value)));
		}

		public static explicit operator double(JToken value)
		{
			JValue jValue = smethod_0(value);
			if (jValue != null && smethod_2(jValue, jtokenType_1, bool_0: false))
			{
				if (jValue.Value is BigInteger)
				{
					return (double)(BigInteger)jValue.Value;
				}
				return Convert.ToDouble(jValue.Value, CultureInfo.InvariantCulture);
			}
			throw new ArgumentException("Can not convert {0} to Double.".smethod_0(CultureInfo.InvariantCulture, smethod_1(value)));
		}

		public static explicit operator float(JToken value)
		{
			JValue jValue = smethod_0(value);
			if (jValue != null && smethod_2(jValue, jtokenType_1, bool_0: false))
			{
				if (jValue.Value is BigInteger)
				{
					return (float)(BigInteger)jValue.Value;
				}
				return Convert.ToSingle(jValue.Value, CultureInfo.InvariantCulture);
			}
			throw new ArgumentException("Can not convert {0} to Single.".smethod_0(CultureInfo.InvariantCulture, smethod_1(value)));
		}

		public static explicit operator string(JToken value)
		{
			if (value == null)
			{
				return null;
			}
			JValue jValue = smethod_0(value);
			if (jValue != null && smethod_2(jValue, jtokenType_3, bool_0: true))
			{
				if (jValue.Value == null)
				{
					return null;
				}
				if (jValue.Value is byte[])
				{
					return Convert.ToBase64String((byte[])jValue.Value);
				}
				if (jValue.Value is BigInteger)
				{
					return ((BigInteger)jValue.Value).ToString(CultureInfo.InvariantCulture);
				}
				return Convert.ToString(jValue.Value, CultureInfo.InvariantCulture);
			}
			throw new ArgumentException("Can not convert {0} to String.".smethod_0(CultureInfo.InvariantCulture, smethod_1(value)));
		}

		[CLSCompliant(false)]
		public static explicit operator uint(JToken value)
		{
			JValue jValue = smethod_0(value);
			if (jValue != null && smethod_2(jValue, jtokenType_1, bool_0: false))
			{
				if (jValue.Value is BigInteger)
				{
					return (uint)(BigInteger)jValue.Value;
				}
				return Convert.ToUInt32(jValue.Value, CultureInfo.InvariantCulture);
			}
			throw new ArgumentException("Can not convert {0} to UInt32.".smethod_0(CultureInfo.InvariantCulture, smethod_1(value)));
		}

		[CLSCompliant(false)]
		public static explicit operator ulong(JToken value)
		{
			JValue jValue = smethod_0(value);
			if (jValue != null && smethod_2(jValue, jtokenType_1, bool_0: false))
			{
				if (jValue.Value is BigInteger)
				{
					return (ulong)(BigInteger)jValue.Value;
				}
				return Convert.ToUInt64(jValue.Value, CultureInfo.InvariantCulture);
			}
			throw new ArgumentException("Can not convert {0} to UInt64.".smethod_0(CultureInfo.InvariantCulture, smethod_1(value)));
		}

		public static explicit operator byte[](JToken value)
		{
			if (value == null)
			{
				return null;
			}
			JValue jValue = smethod_0(value);
			if (jValue != null && smethod_2(jValue, jtokenType_9, bool_0: false))
			{
				if (jValue.Value is string)
				{
					return Convert.FromBase64String(Convert.ToString(jValue.Value, CultureInfo.InvariantCulture));
				}
				if (jValue.Value is BigInteger)
				{
					return ((BigInteger)jValue.Value).ToByteArray();
				}
				if (!(jValue.Value is byte[]))
				{
					throw new ArgumentException("Can not convert {0} to byte array.".smethod_0(CultureInfo.InvariantCulture, smethod_1(value)));
				}
				return (byte[])jValue.Value;
			}
			throw new ArgumentException("Can not convert {0} to byte array.".smethod_0(CultureInfo.InvariantCulture, smethod_1(value)));
		}

		public static explicit operator Guid(JToken value)
		{
			JValue jValue = smethod_0(value);
			if (jValue != null && smethod_2(jValue, jtokenType_4, bool_0: false))
			{
				if (jValue.Value is byte[])
				{
					return new Guid((byte[])jValue.Value);
				}
				if (!(jValue.Value is Guid))
				{
					return new Guid(Convert.ToString(jValue.Value, CultureInfo.InvariantCulture));
				}
				return (Guid)jValue.Value;
			}
			throw new ArgumentException("Can not convert {0} to Guid.".smethod_0(CultureInfo.InvariantCulture, smethod_1(value)));
		}

		public static explicit operator Guid?(JToken value)
		{
			if (value == null)
			{
				return null;
			}
			JValue jValue = smethod_0(value);
			if (jValue != null && smethod_2(jValue, jtokenType_4, bool_0: true))
			{
				if (jValue.Value == null)
				{
					return null;
				}
				if (jValue.Value is byte[])
				{
					return new Guid((byte[])jValue.Value);
				}
				return (jValue.Value is Guid) ? ((Guid)jValue.Value) : new Guid(Convert.ToString(jValue.Value, CultureInfo.InvariantCulture));
			}
			throw new ArgumentException("Can not convert {0} to Guid.".smethod_0(CultureInfo.InvariantCulture, smethod_1(value)));
		}

		public static explicit operator TimeSpan(JToken value)
		{
			JValue jValue = smethod_0(value);
			if (jValue != null && smethod_2(jValue, jtokenType_5, bool_0: false))
			{
				if (!(jValue.Value is TimeSpan))
				{
					return Class182.smethod_4(Convert.ToString(jValue.Value, CultureInfo.InvariantCulture));
				}
				return (TimeSpan)jValue.Value;
			}
			throw new ArgumentException("Can not convert {0} to TimeSpan.".smethod_0(CultureInfo.InvariantCulture, smethod_1(value)));
		}

		public static explicit operator TimeSpan?(JToken value)
		{
			if (value == null)
			{
				return null;
			}
			JValue jValue = smethod_0(value);
			if (jValue != null && smethod_2(jValue, jtokenType_5, bool_0: true))
			{
				if (jValue.Value == null)
				{
					return null;
				}
				return (jValue.Value is TimeSpan) ? ((TimeSpan)jValue.Value) : Class182.smethod_4(Convert.ToString(jValue.Value, CultureInfo.InvariantCulture));
			}
			throw new ArgumentException("Can not convert {0} to TimeSpan.".smethod_0(CultureInfo.InvariantCulture, smethod_1(value)));
		}

		public static explicit operator Uri(JToken value)
		{
			if (value == null)
			{
				return null;
			}
			JValue jValue = smethod_0(value);
			if (jValue != null && smethod_2(jValue, jtokenType_6, bool_0: true))
			{
				if (jValue.Value == null)
				{
					return null;
				}
				if (!(jValue.Value is Uri))
				{
					return new Uri(Convert.ToString(jValue.Value, CultureInfo.InvariantCulture));
				}
				return (Uri)jValue.Value;
			}
			throw new ArgumentException("Can not convert {0} to Uri.".smethod_0(CultureInfo.InvariantCulture, smethod_1(value)));
		}

		private static BigInteger smethod_3(JToken jtoken_2)
		{
			JValue jValue = smethod_0(jtoken_2);
			if (jValue == null || !smethod_2(jValue, jtokenType_2, bool_0: false))
			{
				throw new ArgumentException("Can not convert {0} to BigInteger.".smethod_0(CultureInfo.InvariantCulture, smethod_1(jtoken_2)));
			}
			return Class182.smethod_6(jValue.Value);
		}

		private static BigInteger? smethod_4(JToken jtoken_2)
		{
			JValue jValue = smethod_0(jtoken_2);
			if (jValue != null && smethod_2(jValue, jtokenType_2, bool_0: true))
			{
				if (jValue.Value == null)
				{
					return null;
				}
				return Class182.smethod_6(jValue.Value);
			}
			throw new ArgumentException("Can not convert {0} to BigInteger.".smethod_0(CultureInfo.InvariantCulture, smethod_1(jtoken_2)));
		}

		public static implicit operator JToken(bool value)
		{
			return new JValue(value);
		}

		public static implicit operator JToken(DateTimeOffset value)
		{
			return new JValue(value);
		}

		public static implicit operator JToken(bool? value)
		{
			return new JValue(value);
		}

		public static implicit operator JToken(long value)
		{
			return new JValue(value);
		}

		public static implicit operator JToken(DateTime? value)
		{
			return new JValue(value);
		}

		public static implicit operator JToken(DateTimeOffset? value)
		{
			return new JValue(value);
		}

		public static implicit operator JToken(decimal? value)
		{
			return new JValue(value);
		}

		public static implicit operator JToken(double? value)
		{
			return new JValue(value);
		}

		[CLSCompliant(false)]
		public static implicit operator JToken(short value)
		{
			return new JValue(value);
		}

		[CLSCompliant(false)]
		public static implicit operator JToken(ushort value)
		{
			return new JValue(value);
		}

		public static implicit operator JToken(int value)
		{
			return new JValue(value);
		}

		public static implicit operator JToken(int? value)
		{
			return new JValue(value);
		}

		public static implicit operator JToken(DateTime value)
		{
			return new JValue(value);
		}

		public static implicit operator JToken(long? value)
		{
			return new JValue(value);
		}

		public static implicit operator JToken(float? value)
		{
			return new JValue(value);
		}

		public static implicit operator JToken(decimal value)
		{
			return new JValue(value);
		}

		[CLSCompliant(false)]
		public static implicit operator JToken(short? value)
		{
			return new JValue(value);
		}

		[CLSCompliant(false)]
		public static implicit operator JToken(ushort? value)
		{
			return new JValue(value);
		}

		[CLSCompliant(false)]
		public static implicit operator JToken(uint? value)
		{
			return new JValue(value);
		}

		[CLSCompliant(false)]
		public static implicit operator JToken(ulong? value)
		{
			return new JValue(value);
		}

		public static implicit operator JToken(double value)
		{
			return new JValue(value);
		}

		public static implicit operator JToken(float value)
		{
			return new JValue(value);
		}

		public static implicit operator JToken(string value)
		{
			return new JValue(value);
		}

		[CLSCompliant(false)]
		public static implicit operator JToken(uint value)
		{
			return new JValue(value);
		}

		[CLSCompliant(false)]
		public static implicit operator JToken(ulong value)
		{
			return new JValue(value);
		}

		public static implicit operator JToken(byte[] value)
		{
			return new JValue(value);
		}

		public static implicit operator JToken(Uri value)
		{
			return new JValue(value);
		}

		public static implicit operator JToken(TimeSpan value)
		{
			return new JValue(value);
		}

		public static implicit operator JToken(TimeSpan? value)
		{
			return new JValue(value);
		}

		public static implicit operator JToken(Guid value)
		{
			return new JValue(value);
		}

		public static implicit operator JToken(Guid? value)
		{
			return new JValue(value);
		}

		IEnumerator IEnumerable.GetEnumerator()
		{
			return ((IEnumerable<JToken>)this).GetEnumerator();
		}

		IEnumerator<JToken> IEnumerable<JToken>.GetEnumerator()
		{
			return Children().GetEnumerator();
		}

		internal abstract int Newtonsoft_002EJson_002ELinq_002EJToken_002E_200C_202A_206D_200B_206C_206F_202A_200F_200E_206E_200D_202D_200B_200D_206E_202D_206E_200D_202E_206B_206F_206F_202B_206D_206D_202E_206C_200F_202D_202A_206B_206B_200D_202A_200C_202D_200F_202A_206F_200F_202E();

		public JsonReader CreateReader()
		{
			return new JTokenReader(this);
		}

		internal static JToken smethod_5(object object_0, JsonSerializer jsonSerializer_0)
		{
			Class204.smethod_2(object_0, "o");
			Class204.smethod_2(jsonSerializer_0, "jsonSerializer");
			using JTokenWriter jTokenWriter = new JTokenWriter();
			jsonSerializer_0.Serialize(jTokenWriter, object_0);
			return jTokenWriter.Token;
		}

		public static JToken FromObject(object o)
		{
			return smethod_5(o, JsonSerializer.CreateDefault());
		}

		public static JToken FromObject(object o, JsonSerializer jsonSerializer)
		{
			return smethod_5(o, jsonSerializer);
		}

		public T ToObject<T>()
		{
			return (T)ToObject(typeof(T));
		}

		public object ToObject(Type objectType)
		{
			if (JsonConvert.DefaultSettings == null)
			{
				switch (Class182.smethod_0(objectType))
				{
				case Enum17.Char:
					return (char)this;
				case Enum17.CharNullable:
					return (char?)this;
				case Enum17.Boolean:
					return (bool)this;
				case Enum17.BooleanNullable:
					return (bool?)this;
				case Enum17.SByte:
					return (sbyte?)(short?)this;
				case Enum17.SByteNullable:
					return (sbyte)(short)this;
				case Enum17.Int16:
					return (short)this;
				case Enum17.Int16Nullable:
					return (short?)this;
				case Enum17.UInt16:
					return (ushort)this;
				case Enum17.UInt16Nullable:
					return (ushort?)this;
				case Enum17.Int32:
					return (int)this;
				case Enum17.Int32Nullable:
					return (int?)this;
				case Enum17.Byte:
					return (byte)this;
				case Enum17.ByteNullable:
					return (byte?)this;
				case Enum17.UInt32:
					return (uint)this;
				case Enum17.UInt32Nullable:
					return (uint?)this;
				case Enum17.Int64:
					return (long)this;
				case Enum17.Int64Nullable:
					return (long?)this;
				case Enum17.UInt64:
					return (ulong)this;
				case Enum17.UInt64Nullable:
					return (ulong?)this;
				case Enum17.Single:
					return (float)this;
				case Enum17.SingleNullable:
					return (float?)this;
				case Enum17.Double:
					return (double)this;
				case Enum17.DoubleNullable:
					return (double?)this;
				case Enum17.DateTime:
					return (DateTime)this;
				case Enum17.DateTimeNullable:
					return (DateTime?)this;
				case Enum17.DateTimeOffset:
					return (DateTimeOffset)this;
				case Enum17.DateTimeOffsetNullable:
					return (DateTimeOffset?)this;
				case Enum17.Decimal:
					return (decimal)this;
				case Enum17.DecimalNullable:
					return (decimal?)this;
				case Enum17.Guid:
					return (Guid)this;
				case Enum17.GuidNullable:
					return (Guid?)this;
				case Enum17.TimeSpan:
					return (TimeSpan)this;
				case Enum17.TimeSpanNullable:
					return (TimeSpan?)this;
				case Enum17.BigInteger:
					return smethod_3(this);
				case Enum17.BigIntegerNullable:
					return smethod_4(this);
				case Enum17.Uri:
					return (Uri)this;
				case Enum17.String:
					return (string)this;
				}
			}
			return ToObject(objectType, JsonSerializer.CreateDefault());
		}

		public T ToObject<T>(JsonSerializer jsonSerializer)
		{
			return (T)ToObject(typeof(T), jsonSerializer);
		}

		public object ToObject(Type objectType, JsonSerializer jsonSerializer)
		{
			Class204.smethod_2(jsonSerializer, "jsonSerializer");
			using JTokenReader reader = new JTokenReader(this);
			return jsonSerializer.Deserialize(reader, objectType);
		}

		public static JToken ReadFrom(JsonReader reader)
		{
			Class204.smethod_2(reader, "reader");
			if (reader.JsonToken_0 == JsonToken.None && !reader.Read())
			{
				throw JsonReaderException.smethod_1(reader, "Error reading JToken from JsonReader.");
			}
			if (reader.JsonToken_0 == JsonToken.StartObject)
			{
				return JObject.Load(reader);
			}
			if (reader.JsonToken_0 == JsonToken.StartArray)
			{
				return JArray.Load(reader);
			}
			if (reader.JsonToken_0 == JsonToken.PropertyName)
			{
				return JProperty.Load(reader);
			}
			if (reader.JsonToken_0 == JsonToken.StartConstructor)
			{
				return JConstructor.Load(reader);
			}
			if (JsonReader.smethod_1(reader.JsonToken_0))
			{
				throw JsonReaderException.smethod_1(reader, "Error reading JToken from JsonReader. Unexpected token: {0}".smethod_0(CultureInfo.InvariantCulture, reader.JsonToken_0));
			}
			return new JValue(reader.Object_0);
		}

		public static JToken Parse(string json)
		{
			JsonReader jsonReader = new JsonTextReader(new StringReader(json));
			JToken result = Load(jsonReader);
			if (jsonReader.Read() && jsonReader.JsonToken_0 != JsonToken.Comment)
			{
				throw JsonReaderException.smethod_1(jsonReader, "Additional text found in JSON string after parsing content.");
			}
			return result;
		}

		public static JToken Load(JsonReader reader)
		{
			return ReadFrom(reader);
		}

		internal void method_0(IJsonLineInfo ijsonLineInfo_0)
		{
			if (ijsonLineInfo_0 != null && ijsonLineInfo_0.HasLineInfo())
			{
				method_1(ijsonLineInfo_0.LineNumber, ijsonLineInfo_0.LinePosition);
			}
		}

		internal void method_1(int int_0, int int_1)
		{
			nullable_0 = int_0;
			nullable_1 = int_1;
		}

		bool IJsonLineInfo.HasLineInfo()
		{
			if (nullable_0.HasValue)
			{
				return nullable_1.HasValue;
			}
			return false;
		}

		public JToken SelectToken(string path)
		{
			return SelectToken(path, errorWhenNoMatch: false);
		}

		public JToken SelectToken(string path, bool errorWhenNoMatch)
		{
			Class89 @class = new Class89(path);
			return @class.method_2(this, errorWhenNoMatch);
		}

		protected virtual DynamicMetaObject GetMetaObject(Expression parameter)
		{
			return new Class144<JToken>(parameter, this, new Class86<JToken>(), dontFallbackFirst: true);
		}

		DynamicMetaObject IDynamicMetaObjectProvider.GetMetaObject(Expression parameter)
		{
			return GetMetaObject(parameter);
		}

		object ICloneable.Clone()
		{
			return DeepClone();
		}

		public JToken DeepClone()
		{
			return Newtonsoft_002EJson_002ELinq_002EJToken_002E_206F_206A_202E_200B_200D_206A_200C_200E_206A_202D_200E_206E_206F_200B_206C_200F_200C_200C_202A_206B_200C_202D_200B_202B_202A_202D_202B_206A_206F_206F_202D_200C_206F_202E_206B_200D_206C_202D_202E_200E_202E();
		}
	}
}
